package demo.practice.stack;

public class P1598 {
    public int minOperations(String[] logs) {
        int sum = 0;
        for (String s : logs) {
            if (s.equals("../")) {
                if (sum > 0)
                    sum--;
            } else if (s.equals("./")) {
                //do nothing
            } else {
                sum++;
            }
        }
        return sum;
    }

}
